<!--厂商证照-->
<style scoped lang="less">
  .r-txt {
    text-align: right;
    width:75%;
  }
</style>

<template>
  <div class="contain">
    <!-- <div class="text-list mb30">
      <li class="displayflex">
        <span class="l-txt flex1">证件类型</span>
        <input v-bind:readonly="viewOnly" class="r-txt" value="营业执照">
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">发证日期</span>
        <input v-bind:readonly="viewOnly" class="r-txt" value="2012-07-10">
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">期限类型</span>
        <input v-bind:readonly="viewOnly" class="r-txt" value="有期限">
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">有效期至</span>
        <input v-bind:readonly="viewOnly" class="r-txt" value="2022-07-10">
      </li>
    </div> -->

    <uploader :title="'厂商证照'" :img-list="imgList" :max="max"></uploader>
  </div>
</template>

<script>
import uploader from '@/components/share/imageUploader/imageUploader.vue';
export default {
  name: 'Manufacturer',
  components: {
    uploader,
  },
  data() {
    return {
      viewOnly: true,
      imgList: [],
      max:9,
    };
  },
  watch: {
  },
  computed: {
    userinfo(){
      return localStorage.getItem('userinfo') === null?null:JSON.parse(localStorage.getItem('userinfo'));
    }
  },
  created() {
    this.SetPageType();
    this.GetData();
  },
  mounted() {
    this.$nextTick(function() {
    });
  },
  methods: {
    GetData(){
      this.Ajax.post(`/wxh/excsupplier/${this.$route.query.Guid}/producerpic`).then((res) => {
        if (res.errorCode == 0) {
          let data = res.data;
          if(data) {
            this.imgList = data;
          }
        } else {
          this.Toast({
            message: res.message || '操作异常，请稍后重试',
          });
        };
      });
    },

    SetPageType(){
      if(this.viewOnly){
        this.max = 0;
      }
    }
  }
  
}
</script>
